//=============================================================================

#include "../../../../inc/aAnimationsTrack.h"

//=============================================================================

#define DEFAULT L"defaultAnimation"

//=============================================================================

aAnimationsTrack::aAnimationsTrack()
{
  mtx = 0;
  caption = DEFAULT;
  framesCount = 0;
  currentFrame = 0;
  matrixCalculator = 0;
}

//=============================================================================

aAnimationsTrack::aAnimationsTrack(const aAnimationsTrack& track)
{
  aaCloneAnimationTrack(track);
}

//=============================================================================

void aAnimationsTrack::aaRemoveTrackInformation()
{
  if (mtx)
  {
    delete [] mtx;
    mtx = 0;
  }
  framesCount = 0;
  caption = DEFAULT;
}

//=============================================================================

const aAnimationsTrack& aAnimationsTrack::operator=(const aAnimationsTrack& track)
{
  aaCloneAnimationTrack(track);

  return (*this);
}

//=============================================================================

void aAnimationsTrack::aaCloneAnimationTrack(const aAnimationsTrack &track)
{
  caption = track.caption;
  framesCount = track.framesCount;
  currentFrame = track.currentFrame;
  matrixCalculator = track.matrixCalculator;
  memcpy(mtx, track.mtx, sizeof(float)*MATRIX_SIZE*framesCount);
}

//=============================================================================

aAnimationsTrack::~aAnimationsTrack()
{
  aaRemoveTrackInformation();
}

//=============================================================================
